
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../generated/l10n.dart';
import '../manager/config.dart';

class ComplaintPage extends StatefulWidget {
  @override
  State<ComplaintPage> createState() => ComplaintPageState();
}

class ComplaintPageState extends State<ComplaintPage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBodyBehindAppBar: true,
      appBar: AppBar(
        iconTheme: IconThemeData(color: Colors.white),
        title: Text(S.current.COMPLAINT_TEXT, style: NaviTitleStyle,),
        centerTitle: true,
        backgroundColor: Colors.transparent,
        shadowColor: Colors.transparent,
        elevation: 0,
        leading: IconButton(
          icon: Icon(Icons.arrow_back_ios_sharp, color: Colors.black,),
          onPressed: () {
            Navigator.of(context).pop();
          },
        ),
      ),
      body: Stack(
        children: [
          Container(
            child: Column(
              children: [
                Container(
                  margin: EdgeInsets.only(left: 24.sp, right: 24.sp, top: 112.sp),
                  height: 138.sp,
                  child: Column(
                    children: [
                      Container(
                        child: Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Container(
                              height: 21.sp,
                              alignment: Alignment.topLeft,
                              child: Text(
                                S.current.UPLOAD_IMAGE_TEXT,
                                style: TextStyle(color: Color(0xFF333333), fontSize: 15.sp, fontWeight: FontWeight.w500),
                              ),
                            ),

                            Container(
                              height: 21.sp,
                              alignment: Alignment.topRight,
                              child: Text(
                                S.current.UPLOAD_MOST + "9" + S.current.UPLOAD_UNIT,
                                style: TextStyle(color: Color(0xFF999999), fontSize: 15.sp, fontWeight: FontWeight.w500),
                              ),
                            )
                          ],
                        ),
                      ),
                      Expanded(child: Container(
                        margin: EdgeInsets.only(top: 16.sp),
                        height: 101.sp,
                        child: ListView(
                          scrollDirection: Axis.horizontal,
                          children: [
                            Container(
                              width: 101.sp,
                              height: 101.sp,
                              child: Center(
                                child: Container(
                                  decoration: BoxDecoration(
                                    border: Border.all(
                                      color: Colors.grey,
                                      width: 1.sp,
                                      style: BorderStyle.solid,

                                    ),
                                  ),
                                  width: 28.sp, height: 28.sp,
                                  child: Image.asset( 'assets/images/add_image.png'),
                                ),
                              ),
                            ),
                            Row(
                              children: [],
                            )
                          ],
                        ),
                      )),
                    ],
                  ),
                ),


                Container(
                  margin: EdgeInsets.only(left: 24.sp, right: 24.sp, top: 16.sp),
                  alignment: Alignment.topLeft,
                  child: Text(
                    S.current.SHOW_COMPLAINT_REASON_TEXT,
                    style: TextStyle(color: Color(0xFF333333), fontSize: 15.sp, fontWeight: FontWeight.w500),
                  ),
                ),

                Container(
                  margin: EdgeInsets.only(left: 24.sp, right: 24.sp, top: 16.sp),
                  child: TextField(
                    maxLines: null,
                    keyboardType: TextInputType.multiline,
                    decoration: InputDecoration(
                        contentPadding: EdgeInsets.symmetric(horizontal: 12.sp, vertical: 12.sp),
                        hintText: S.current.INPUT_COMPLAINT_REASON_TEXT,
                        border: InputBorder.none
                    ),
                    maxLength: 200,
                  ),
                )
              ],
            ),
          ),
          GestureDetector(
            child: Container(
              width: double.infinity,
              height: 44.sp,
              margin: EdgeInsets.only(left: 16.sp, right: 16.sp, top: 610.sp),
              decoration: BoxDecoration(
                color: Color(0xFF00CA7E),
                borderRadius: BorderRadius.circular(22.sp), // 设置圆角半径
              ),
              child: Center(
                child: Text(
                  S.current.SUBMIT_TEXT,
                  style: TextStyle(color: Colors.white, fontSize: 16.sp),
                ),
              ),
            ),
            onTap: () {

            },
          ),
        ],
      ),
    );
  }
}